package dht.message;

import java.io.Serializable;
import java.net.InetAddress;

import dht.data.TabBigInteger;

/**
 * Message est la classe representant un message qui circule entre les noeuds.
 * 
 * @author bouceka
 *
 */
public abstract class Message implements Serializable {
	
	
	private static final long serialVersionUID = 2411574464984611930L;
	
	public static final int ACK_Message=1;
	public static final int REPLY_Message=2;
	public static final int CONTEXTE_Message=3;
	public static final int JOIN_Message=4;
	public static final int MISS_Message=5;
	public static final int PUT_Message=6;
	public static final int QUIT_Message=7;
	public static final int GET_Message=8;
	public static final int MAJ_Message=8;
	
	
	/**
	 * type du message reçu sur le réseau
	 */
	public int TYPE_MSG;
		
	/**
	 * Adresse ip du destinataire du message
	 */
	private final InetAddress adresseIpExp;
	
	
	
	/**
	 * Identifiant virtuel du noeud expediteur
	 */
	private final String virtualId;
	
	/**
	 * Coordonnees du point de destination.
	 */
	private final TabBigInteger destination;
	
	
	public Message(InetAddress adresseIpExp, String virtualId, TabBigInteger destination){
		this.adresseIpExp = adresseIpExp;
		this.virtualId = virtualId;
		this.destination = destination;
		this.TYPE_MSG=-1;
	}

	public InetAddress getadresseIpExp() {
		return adresseIpExp;
	}

	public String getVirtualId() {
		return virtualId;
	}

	public TabBigInteger getDestination() {
		return destination;
	}
	


}
